package genetics;

import java.io.Serializable;

public class Individual implements Serializable
{

    private double[] identityDisc;
    private double utility;

    public Individual(double[] identityDisc)
    {
        this.identityDisc = identityDisc.clone();
    }

    public Individual(double[] identityDisc, double utility)
    {
        this.identityDisc = identityDisc.clone();
        this.utility = utility;
    }

    public void printDisk()
    {
        System.out.println("IdentityDisc " + identityDisc.length + " print: ");
        for (int i = 0; i < identityDisc.length; i++) {
            System.out.println(identityDisc[i]);
        }
        System.out.println(" END OF LINE");
    }

    public double getSector(int index)
    {
        return identityDisc[index];
    }

    public double[] getIdentityDisc()
    {
        return identityDisc;
    }

    public double getUtility()
    {
        return utility;
    }

    public void setUtility(double utility)
    {
        this.utility = utility;
    }
}
